Colour Contrast Checker

WCAG AA and AAA, checked on real text

Large heading text
This is body text. Check whether a long paragraph stays comfortable to read at this size.
Bold 18.66px+ counts as large text
-
Contrast ratio (1:1 ~ 21:1)
AA · Normal text
-
4.5:1
AA · Large text
-
3:1
AAA · Normal text
-
7:1
AAA · Large text
-
4.5:1
Calculated with the WCAG 2.1 relative luminance formula. "Large text" means 18.66px or larger in bold, or 24px or larger otherwise.

What this tool does

Enter a text colour and background with the colour picker or a hex code (#RGB or #RRGGBB), and it calculates the contrast ratio and shows pass or fail for WCAG AA and AAA, separately for normal and large text. A preview box draws the actual combination, and if it falls short of AA for body text (4.5:1) a button appears that adjusts the text colour automatically. Use it when choosing colours for web or app design, slides or notices.

How it is calculated

Each RGB value is scaled to 0 to 1 and gamma is undone (values up to 0.03928 are divided by 12.92; larger ones become ((value + 0.055) ÷ 1.055) to the power 2.4), then weighted by 0.2126 red, 0.7152 green and 0.0722 blue to get relative luminance. The ratio is (lighter luminance + 0.05) ÷ (darker luminance + 0.05), from 1:1 to 21:1. For example, the default grey #6B7280 on white is 4.83:1, passing AA for normal text but failing AAA (7:1). #999999 is 2.85:1, failing even the large-text threshold (3:1). The auto-adjust button moves the text colour's R, G and B by 1 at a time, darker on a light background or lighter on a dark one, and stops at the first colour above 4.5:1.

Things to know

Frequently asked questions

Should I aim for AA or AAA?

Many accessibility regulations and public standards require AA. AAA is a stricter recommendation, often targeted for long body text or public services. Requirements vary by organisation and law and can change.

How light a grey can I use on white?

#767676 at about 4.54:1 is the grey closest to the AA normal-text threshold. Anything lighter fails, so keep even secondary text at or below that lightness.

My brand colour fails. What can I do?

A common approach is to use the brand colour for backgrounds or accents and switch the text on it to a high-contrast colour. You can also use auto-adjust to find a darker or lighter variant.

Is higher contrast always better?

Passing the threshold comes first, but some find very strong contrast such as pure black on pure white tiring for long reading. Softening it a little while still passing is fine.

📚 Worth reading
🎚️Photo editing basics: the order and when to stop→ 🎨Colour Contrast Rules: WCAG 4.5:1, 3:1, 7:1 and Large Text→ 🎨Building a colour palette: complementary, analogous and triadic→ 📊How to Read a Photo Histogram: Checking Exposure on a Graph→